<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>appendChild</title>
	<style>
		*{padding:0;margin:0;}
		#did{
			width:400px;
			height:400px;
			border:1px solid red;
		}
		img{
			width:200px;
			height:200px;
		}
	</style>
</head>
<body>
	<div id="did" ></div>
	<select id="sid">
		<option value="1.jpg">1.jpg</option>
		<option value="2.jpg">2.jpg</option>
		<option value="3.jpg">3.jpg</option>
		<option value="4.jpg">4.jpg</option>
	</select>
	<button onclick="fun()" >添加</button>
</body>
	<script>
		sid = document.getElementById("sid");
		did = dcoument.getElementById("did");
		function fun(){
			v = sid.value;
			img = document.createElement("img");
			img.setAttribute("src","./images/"+v);
			did.appendChild(img);
		}
	</script>
</html>